package com.example.demo.page.detail

import com.example.demo.base.BaseViewModel

/**
 * 登录成功后展示的页面
 */
class LoginSuccessViewModel : BaseViewModel<LoginSuccessAction, LoginSuccessState, LoginSuccessEvent>() {
    override fun onAction(action: LoginSuccessAction, state: LoginSuccessState?) {
        when (action) {
            LoginSuccessAction.Navigation -> {
                //必须在登陆成功获取到数字时候才能跳转
//                if (currentState is LoginSuccessState.Back) {//返回上一页
//                    emitEffect { LoginSuccessEvent.NavigationToHost(1) }
//                }
            }
        }
    }

    /**
     * 模拟登陆
     */
    private fun login() {
//        emitState { DemoState.Loading }

    }


}